// pages/schoolScenery/schoolScenery.js
var businessLogic = require('../../../utils/NetWork/Model/HomebusinessLogic.js')
var WxParse = require('../../../utils/Component/wxParse/wxParse.js');
var common = require('../../../utils/common.js')
Page({

  /**
   * 页面的初始数据
   */
  data: {
    post_title: [],
    banner_url: [],
    indicatorDots: true,
    vertical: false,
    autoplay: true,
    interval: 3000,
    duration: 1000,
    swiperCurrent: 0,
    orgid:"",
    userid:""
  },
  swiperChange: function (e) {
    this.setData({
      swiperCurrent: e.detail.current
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var orgid = common.getStorageSync("orgid")
    var userid = common.getStorageSync("userid")
    this.setData({
      orgid: orgid,
      userid:userid
    });
    var ryid = options.id;
    // console.log("ryid",ryid);
    this.rytemp(ryid);
  }, rytemp: function (ryid) {
    let params = { "orgid":this.data.orgid, userid: this.data.userid, id: ryid };
    businessLogic.SceneryInfo(params, (res) => {
      this.setData({
        post_title: res,
        banner_url:res.pics
      });
      // console.log("post_title",this.data.post_title);
      var article = res.sceneryDescription;
      var that = this;
      WxParse.wxParse('article', 'html', article, that, 20);
    });
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
  
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
  
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
  
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
  
  }
})